home *** CD-ROM | disk | FTP | other *** search
- Path: news.pi.net!news
- From: cat.tech@pi.net (Remy Cool)
- Newsgroups: comp.lang.c++
- Subject: Re: Problem: ERROR: Cannot convert 'const void * ' to ' const HBITMAP_* '
- Date: Sat, 02 Mar 1996 18:27:19 GMT
- Organization: Cool Applied Technology
- Message-ID: <4ha40t$rbc@neptunus.pi.net>
- References: <4h9a8h$89i@neptunus.pi.net>
- Reply-To: cool@pi.net
- NNTP-Posting-Host: hen26.pi.net
- X-Newsreader: Forte Free Agent 1.0.82
-
- Found the sollution.....
-
- This is the CODE...
-
- HDC hdc, hdcMemory;
- HBITMAP hbmpMyBitmap, hbmpOld;
- BITMAP bm;
-
- hbmpMyBitmap = LoadBitmap(GetApplication()->hInstance, "MyBMP");
- GetObject(hbmpMyBitmap, sizeof(BITMAP), &bm);
-
- hdc = GetDC(HWindow);
- hdcMemory = CreateCompatibleDC(hdc);
- hbmpOld =(HBITMAP)SelectObject(hdcMemory, hbmpMyBitmap); /* LINE 10 */
-
- BitBlt(hdc, 100, 100, bm.bmWidth, bm.bmHeight, hdcMemory, 0, 0, SRCCOPY);
- SelectObject(hdcMemory, hbmpOld);
-
- DeleteDC(hdcMemory);
- ReleaseDC(HWindow, hdc);
- DeleteObject(hbmpMyBitmap);
-
- **** Changes to the original code:
-
- Place (HBITMAP) before the SelectObject(.......) /* LINE 10 */
- Remove (all) #define MyBMP 1000 (from the .rc file)
-
- Then it works fine ......
-
- Regards,
-
- Remy
-
-